package com.sds.sweng.swat.miplatform.ui.design.parts;

import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPartFactory;

import com.sds.sweng.swat.miplatform.ui.design.models.MiplatformDesignModel;
import com.sds.sweng.swat.miplatform.ui.design.models.area.AreaTemplateTitle;
import com.sds.sweng.swat.miplatform.ui.design.models.area.GeneralAreaTemplate;
import com.sds.sweng.swat.miplatform.ui.design.models.area.GridAreaTemplate;
import com.sds.sweng.swat.miplatform.ui.design.models.area.SearchAreaTemplate;
import com.sds.sweng.swat.miplatform.ui.design.models.area.TabAreaTemplate;
import com.sds.sweng.swat.miplatform.ui.design.models.area.sub.ButtonSubArea;
import com.sds.sweng.swat.miplatform.ui.design.models.area.sub.GridSubArea;
import com.sds.sweng.swat.miplatform.ui.design.models.area.sub.HorizontalSubAreaContainer;
import com.sds.sweng.swat.miplatform.ui.design.models.area.sub.LinkButtonSubArea;
import com.sds.sweng.swat.miplatform.ui.design.models.area.sub.PagingSubArea;
import com.sds.sweng.swat.miplatform.ui.design.models.area.sub.SubAreaContainer;
import com.sds.sweng.swat.miplatform.ui.design.models.area.sub.SubButtonSubArea;
import com.sds.sweng.swat.miplatform.ui.design.models.area.sub.TabContentsSubArea;
import com.sds.sweng.swat.miplatform.ui.design.models.area.sub.TabHeaderSubArea;
import com.sds.sweng.swat.miplatform.ui.design.models.area.sub.TableCellSubArea;
import com.sds.sweng.swat.miplatform.ui.design.models.area.sub.TableSubArea;
import com.sds.sweng.swat.miplatform.ui.design.models.area.sub.TitleSubArea;
import com.sds.sweng.swat.miplatform.ui.design.models.component.MButton;
import com.sds.sweng.swat.miplatform.ui.design.models.component.MTab;
import com.sds.sweng.swat.miplatform.ui.design.parts.area.AreaTemplateTitlePart;
import com.sds.sweng.swat.miplatform.ui.design.parts.area.GeneralAreaTemplatePart;
import com.sds.sweng.swat.miplatform.ui.design.parts.area.GridAreaTemplatePart;
import com.sds.sweng.swat.miplatform.ui.design.parts.area.SearchAreaTemplatePart;
import com.sds.sweng.swat.miplatform.ui.design.parts.area.TabAreaTemplatePart;
import com.sds.sweng.swat.miplatform.ui.design.parts.area.sub.ButtonSubAreaPart;
import com.sds.sweng.swat.miplatform.ui.design.parts.area.sub.GridSubAreaPart;
import com.sds.sweng.swat.miplatform.ui.design.parts.area.sub.HorizontalSubAreaContainerPart;
import com.sds.sweng.swat.miplatform.ui.design.parts.area.sub.LinkButtonSubAreaPart;
import com.sds.sweng.swat.miplatform.ui.design.parts.area.sub.PagingSubAreaPart;
import com.sds.sweng.swat.miplatform.ui.design.parts.area.sub.SubAreaContainerPart;
import com.sds.sweng.swat.miplatform.ui.design.parts.area.sub.SubButtonSubAreaPart;
import com.sds.sweng.swat.miplatform.ui.design.parts.area.sub.TabContentsSubAreaPart;
import com.sds.sweng.swat.miplatform.ui.design.parts.area.sub.TabHeaderSubAreaPart;
import com.sds.sweng.swat.miplatform.ui.design.parts.area.sub.TableCellSubAreaPart;
import com.sds.sweng.swat.miplatform.ui.design.parts.area.sub.TableSubAreaPart;
import com.sds.sweng.swat.miplatform.ui.design.parts.area.sub.TitleSubAreaPart;
import com.sds.sweng.swat.miplatform.ui.design.parts.component.MButtonPart;
import com.sds.sweng.swat.miplatform.ui.design.parts.component.MTabPart;

public class MiplatformDesignPartFactory implements EditPartFactory {

	public EditPart createEditPart(EditPart context, Object model) {
		EditPart part = null;

		if (model instanceof MiplatformDesignModel) {
			part = new MiplatformDesignPart();

		} else if (model instanceof SearchAreaTemplate) {
			part = new SearchAreaTemplatePart();
		} else if (model instanceof GeneralAreaTemplate) {
			part = new GeneralAreaTemplatePart();
		} else if (model instanceof GridAreaTemplate) {
			part = new GridAreaTemplatePart();
		} else if (model instanceof TabAreaTemplate) {
			part = new TabAreaTemplatePart();

		} else if (model instanceof AreaTemplateTitle) {
			part = new AreaTemplateTitlePart();

		} else if (model instanceof SubAreaContainer) {
			part = new SubAreaContainerPart();
		} else if (model instanceof HorizontalSubAreaContainer) {
			part = new HorizontalSubAreaContainerPart();

		} else if (model instanceof TitleSubArea) {
			part = new TitleSubAreaPart();
		} else if (model instanceof TableSubArea) {
			part = new TableSubAreaPart();
		} else if (model instanceof GridSubArea) {
			part = new GridSubAreaPart();
		} else if (model instanceof PagingSubArea) {
			part = new PagingSubAreaPart();
		} else if (model instanceof ButtonSubArea) {
			part = new ButtonSubAreaPart();
		} else if (model instanceof SubButtonSubArea) {
			part = new SubButtonSubAreaPart();
		} else if (model instanceof LinkButtonSubArea) {
			part = new LinkButtonSubAreaPart();
		} else if (model instanceof TabHeaderSubArea) {
			part = new TabHeaderSubAreaPart();
		} else if (model instanceof TabContentsSubArea) {
			part = new TabContentsSubAreaPart();

		} else if (model instanceof TableCellSubArea) {
			part = new TableCellSubAreaPart();

		} else if (model instanceof MButton) {
			part = new MButtonPart();
		} else if (model instanceof MTab) {
			part = new MTabPart();
		}

		part.setModel(model);

		return part;
	}

}
